﻿using AutoMapper;
using Tb.App.API.Applications.Command.Basic;
using Tb.App.API.Applications.Command.Cultivation;
using Tb.App.API.Applications.Command.DeepProcessing;
using Tb.App.API.Applications.Command.Slaughter;
using Tb.App.Domain.Rabbit.Basic;
using Tb.App.Domain.Rabbit.Cultivation;
using Tb.App.Domain.Rabbit.DeepProcessing;
using Tb.App.Domain.Rabbit.Slaughter;

namespace Tb.App.API.AutoMapperProflie
{
    /// <summary>
    /// 自动映射配置
    /// </summary>
    public class MyMapperProfile:Profile
    {
        /// <summary>
        /// 构造方法
        /// </summary>
        public MyMapperProfile()
        {
            //添加溯源基本信息
            CreateMap<BasicModel, AddBasicCommand>().ReverseMap();
            //修改溯源基本信息
            CreateMap<BasicModel, UpdBasicCommand>().ReverseMap();
            //-----------------------------------------------------
            //添加养殖信息
            CreateMap<CultivationModel, AddCultivationCommand>().ReverseMap();

            //修改免疫信息
            CreateMap<ImmunityModel, UpdImmunityCommand>().ReverseMap();

            //添加养殖企业信息
            CreateMap<CultivationCommpanyModel, AddCultivationCommpanyCommand>().ReverseMap();
            //--------------------------------------------------------------
            //添加屠宰信息
            CreateMap<SlaughterModel, AddSlaughterModelCommand>().ReverseMap();
            //添加屠宰企业信息
            CreateMap<SlaughterCommpany, AddSlaughterCommpanyCommand>().ReverseMap();

            //-------------------------------------------------------------
            //添加深加工信息
            CreateMap<DeepProcessingModel, AddDeeprocessingModelCommand>().ReverseMap();
        }
    }
}
